<?php
class Api_model extends Base_model{

  
    public function getApiEntity($cmd){
	 	$this->app->logger->info("param cmd = ". $cmd );

        $entity = $this->app->db
                ->select('*')
                ->from('trjh_api')
                ->where("cmd=:cmd or alias=:alias")
                ->bindValues(['cmd'=>$cmd,'alias'=>$cmd])
                ->row();
        return $entity;
    }

    public function getAppsecret($appid){
    	$this->app->logger->info("param appid = ". $appid );

        $entity = $this->app->db
                ->select('appsecret')
                ->from('trjh_api_app')
                ->where("appid=:appid and state=:state")
                ->bindValues(['appid'=>$appid,'state'=>1])
                ->row();
        return $entity['appsecret'];
	 
    }



}
